package com.evil.application.api;

import com.evil.application.config.ApplicationFeignErrorDecoder;
import com.evil.application.pojo.dto.robot.*;
import com.evil.common.family.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import jakarta.validation.constraints.NotNull;
import java.util.List;

/**
 * 机器人接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {ApplicationFeignErrorDecoder.class})
public interface RemoteApplicationRobotService {

    /**
     * 应用机器人列表
     *
     * @param applicationRobotsReqDTO applicationRobotsReqDTO
     * @return List
     */
    @PostMapping("/remote/application/robot/list")
    List<ApplicationRobotRespDTO> applicationRobots(@Validated @RequestBody ApplicationRobotsReqDTO applicationRobotsReqDTO);

    /**
     * 应用机器人详情
     *
     * @param robotId robotId
     * @return ApplicationRobotRespDTO
     */
    @PostMapping("/remote/application/robot/info")
    ApplicationRobotRespDTO applicationRobotInfo(@RequestParam("robotId") @NotNull(message = "机器人id不能为空") Long robotId);

    /**
     * 添加应用机器人
     *
     * @param addApplicationRobotReqDTO addApplicationRobotReqDTO
     */
    @PostMapping("/remote/application/robot/add")
    void addApplicationRobot(@Validated @RequestBody AddApplicationRobotReqDTO addApplicationRobotReqDTO);

    /**
     * 编辑应用机器人
     *
     * @param modifyApplicationRobotReqDTO modifyApplicationRobotReqDTO
     */
    @PostMapping("/remote/application/robot/modify")
    void modifyApplicationRobot(@Validated @RequestBody ModifyApplicationRobotReqDTO modifyApplicationRobotReqDTO);

    /**
     * 复制应用机器人
     *
     * @param robotId robotId
     */
    @PostMapping("/remote/application/robot/copy")
    void copyApplicationRobot(@RequestParam("robotId") @NotNull(message = "机器人id不能为空") Long robotId);

    /**
     * 编辑应用机器人状态
     *
     * @param modifyAppRobotStatusReqDTO modifyAppRobotStatusReqDTO
     */
    @PostMapping("/remote/application/robot/modify/status")
    void modifyApplicationRobotStatus(@Validated @RequestBody ModifyAppRobotStatusReqDTO modifyAppRobotStatusReqDTO);

    /**
     * 删除机器人
     *
     * @param robotId robotId
     */
    @PostMapping("/remote/application/robot/delete")
    void deleteApplicationRobot(@RequestParam("robotId") @NotNull(message = "机器人id不能为空") Long robotId);
}
